#include <iostream>
using namespace std;

/*
 i*(i^n - (i-1)^n)/m^n for i in [1,m]
 1*1/m^n + 2*(2^n-1^n)/m^n + ... + i*(i^n - (i-1)^n)/m^n + ... + m*(m^n - (m-1)^n)/m^n
*/
int main()
{
	int m, n;
	cin >> m >> n;

	double ret = 0;
	for (int i = 1; i <= m; ++i)
	{
		double a = i*1.0 / m;
		double b = (i - 1)*1.0 / m;

		double c = pow(a, n);
		double d = pow(b, n);

		ret += (c - d)*i;
	}

	cout << ret << endl;

	return 0;
}